﻿//-----------------------------------------------
//video_mgr by mv 2024/01/02
//-----------------------------------------------
#ifndef _MGR_VIDEO_H
#define _MGR_VIDEO_H
#include <stdio.h>
#include <fcntl.h>
#include <termios.h>
#include <unistd.h>
#include <stdint.h>
#include <sys/ioctl.h>
#include <string.h>
#include <stdarg.h>
#include <iostream>
#include <string>
#include "task/cmd/video_stream/ThreadPoolMgr.h"

//-----------------------------------------------
using namespace std;
//-----------------------------------------------
// 心跳间隔/分钟
#define  heartbeat_minutes 1
// 线程数量
#define  number_of_threads 2

namespace mv
{
	//-----------------------------------------------
	struct VideoMgr
	{
	public:
		VideoMgr();
		VideoMgr(const int iDirection);
		
		~VideoMgr();

		//-------------------------------------------------
		// 车窗检测开关
		//-------------------------------------------------
		int carWindowProcessCtrl(bool bStart);

		//-------------------------------------------------
		// 虹膜预览开关
		//-------------------------------------------------
		int irisCameraPreviewCtrl(bool bOpen);

	private:
		//开启车窗检测流程
		bool startCarWindowProcess();

		//关闭车窗检测流程
		bool stopCarWindowProcess();

		//开启虹膜预览
		bool openIrisCamera();

		//关闭虹膜预览
		bool closeIrisCamera();
		
	private:
		mv::ThreadPool* m_pThreadPool;  //consumer 

		bool m_bCarWindowState = false;	 //车窗检测状态
		std::string m_status;
		std::string m_sLastRevHex = "";
	};
	//-----------------------------------------------
}
#endif //!_MGR_VIDEO_H
